home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
tinycalc
/
tyncalc.fr1
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1995-03-15
|
8KB
|
158 lines
Form1
TYNEE
Form1%
cancelentry
Cancel
Command1
Command6
Paste
Command2
Picture1
Command5
readout
Form_Click
@ form_load0
text1F
text1_SetFocusb
Text1_Change
Text1_GotFocusT
picture1
height
width
Picture1_Click~
picture'
picture1_mousedown$
buttonU
Shift]
pring\
pplat
yThenA
ctotal
label1
caption
recvd_key
Text1_KeyDown
KeyCode
cfunction
clearall
Text2_Change
Label2_Click
Label2_MouseDown|
Label3_Click
clearentry;
function_pressedL
slash
minus
equal
lastplatY
cvalue
Label1_Click
Label1_MouseDown
Label3_MouseDown
cfunction_pressed
lastfunct
caccum0
lfunctionK
functdone
accum
cfungtiono
lastopr
neonM
oflow
oflow2
priorfunctE
prioropr
cfunct
Command1_Click=
form1"
minimize
TRUEZ
windowstate
Command3_Click
Command4_Click
Form_MouseMove
elseifIf+
Command5_Click
clipboard
cf_text
cf_linkc
Command6_Click
gotclipk
noinifile
form2v
loadf
visible
Command2_Click
FALSE]
decimalflag
numops
lastinput
opflag
Cancel_Click
readout
decimal_click
cancelentry_Click
operator_click
lasttotal
incountU
decimal
number_click
times|
opcode
where_place
xplace
yplace
hplace
indata
Tynee
inifile
noinifile2
bottom
pgrid`
I copied most of the code from the calculator sample thatt
was provided with VB from Microsoft (why rewrite it?))
There is a different slant to this program in that I use a
picture instead of buttons for the numbers and operands.
I drew the keyboard in PBRUSH, trying to keep the rows and
columns equal in size. When I got it into the form as
a picture, I found that it was very close (in twips) too
having each row be the same height and each column being
the same width. This enabled me to be able to write the
simple FOR...NEXT code in Picture1_Mousedown.
Subroutine picture1_mousedown shows how I partition thee
picture into "grids" to determine which numbers or operands
were under the mouse when it was clicked..
Mike Wilson CIS 71261,63 August 1991
row, column -- top left to bottom
Cancel_Click
cancelentry_Click
Command1_Click
save the top & left location of the form when minimized
TYNEE.INI
[Tynee]
minimize
Command2_Click
Command5_Click
copy readout to win clipboardo
Command6_Click
retrieve text (hopefully a numeric string) from win clipboard
call rte that processes numbersr
decimal_click
form_load
read the .ini file -- if error, place it in default area
tynee.ini
number_click
operator_click
Can't divide by zero
Tynee
picture1_mousedown
picture1 is divided into 4 rows and 4 columns of equal twips
find row that mouse was clicked on; height of row is 229 twips
tell which row i.e. 40 =row 4
col width is 151 twips; find column that mouse was clicked on
add column to row*10
i.e. row 4, col 1 (O) is 41*
an operand
rest are numbers
go process the number